<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="templatemo_style.css" rel="stylesheet" type="text/css" />
<link href="css/jquery.ennui.contentslider.css" rel="stylesheet"
	type="text/css" media="screen,projection" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="js/jquery.ennui.contentslider.js"></script>
</head>
<body>
	<script>
		$(document).ready(function() {
			var uid = getUrlParam('uid');
			//初始化展示数据库内容
			show(uid);
			showpraise(uid);
		});

		function showpraise(uid) {
			$.ajax({
				url : "/appraise/show",
				type : "post",
				data : {
					uid : uid
				},
				dataType : "json",
				success : function(data) {
					var context = "";
					for (var i = 0; i < data.length; i++) {
						var po = data[i];
						context += '<tr>' + '<th width="80px">' + po.snickname
								+ '</th>' + '<th width="100px">' + po.state
								+ '</th>' + '<th width="120px">' + po.aptime
								+ '</th>' + '<th width="420px">' + po.mes
								+ '</th>' + '_$tag'
					}
					$("#show_coachpraise").html(context);
				}
			});
		}
		function show(uid) {
			$.ajax({
				url : "/coach/one",
				type : "post",
				data : {
					uid : uid
				},
				dataType : "json",
				success : function(data) {
					var image = "_$tag_____________________"
					$("#cimage").html(image);
					$("#cnickname").html(data.cnickname);
					$("#cdescribe").html(data.describe);
					var context = '_$tag_____________________名字：' + data.cname
							+ '_$tag_' + '_$tag_____________________性别：'
							+ data.csex + '_$tag_'
							+ '_$tag_____________________年龄：' + data.cage
							+ '_$tag_' + '_$tag_____________________电话：'
							+ data.ctel + '_$tag_'
							+ '_$tag_____________________QQ：' + data.cqq
							+ '_$tag_'
					$("#coach_mes1").html(context);
					var context2 = '_$tag_____________________流派：'
							+ data.cgenre + '_$tag_'
							+ '_$tag_____________________邮箱：' + data.cmail
							+ '_$tag_' + '_$tag_____________________是否接课：'
							+ data.state + '_$tag_'
							+ '_$tag_____________________空闲时间：' + data.freetime
							+ '_$tag_' + '_$tag_____________________具体地址：'
							+ data.caddrmes + '_$tag_'
					$("#coach_mes2").html(context2);

				}
			});
		}
		//获取url中的参数
		function getUrlParam(name) {
			var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
			var r = window.location.search.substr(1).match(reg); //匹配目标参数
			if (r != null)
				return unescape(r[2]);
			return null; //返回参数值
		}
	</script>
	<div id="templatemo_wrapper">
		<div id="templatemo_left_column">

			<div id="site_title">
				<h1>
					<a href="#">Paper Blog<span>free web template</span></a>
				</h1>
			</div>

			<div id="templatemo_menu">
				<ul>
					<li><a href="#" class="current">Home</a></li>
					<li><a href="#">Free Templates</a></li>
					<li><a href="#">Web Gallery</a></li>
					<li><a href="#">Testimonials</a></li>
					<li><a href="#">Our Company</a></li>
					<li><a href="#">Contact Us</a></li>
				</ul>
			</div>
			<!-- end of templatemo_menu -->
		</div>
		<!-- end of templatemo_left_column -->

		<div id="templatemo_content">

			<div id="templatemo_slider">

				<div id="one" class="contentslider">
					<div class="cs_wrapper">
						<div class="cs_slider">

							<div class="cs_article">
								<div id="cimage"></div>

								<div class="text">
									<h2 id="cnickname"></h2>
									<p id="cdescribe"></p>
								</div>
							</div>
							<!-- End cs_article -->
						</div>
						<!-- End cs_slider -->
					</div>
					<!-- End cs_wrapper -->
				</div>
				<!-- End contentslider -->
			</div>
			<!-- end of slider -->

			<div class="post_section">

				<h2>个人信息</h2>

				<div class="post_content">
					<div class="coach_mes" id="coach_mes1"></div>
					<div class="coach_mes" id="coach_mes2"></div>
				</div>

			</div>

			<div class="post_section">

				<h2>教练评论</h2>

				<div class="post_content">
					<table class="praise-table">
						<tr>
							<th width="80px">评论人</th>
							<th width="100px">评价级别</th>
							<th width="120px">时间</th>
							<th width="420px">内容</th>
						</tr>
						<tbody id="show_coachpraise">

						</tbody>
					</table>
				</div>

			</div>

		</div>
		<!-- end of content -->

	</div>
	<!-- end of templatemo_wrapper -->

	<div id="templatemo_footer_wrapper">
		<div id="templatemo_footer">
	
		</div>
	</div>
</body>
</html>
